import 'package:flutter/material.dart';
class InheritedState extends InheritedWidget {
  const InheritedState({
    Key? key,
    required this.count,
    required Widget child,
  }) : super(key: key, child: child);

  final int count;

  static InheritedState? of(BuildContext context) {
    //给子组件提供一个获取数据的方法
    print('我是内部的inheritedWidget，我也变化了');
    return context.dependOnInheritedWidgetOfExactType<InheritedState>();
  }


  @override
  bool updateShouldNotify(InheritedState old) => count != old.count;    //当color变化的时候刷新；
//通知页面是否刷新

}


//Eventbus\Notification\InheritedWidget

